<template>
  <div class="tabBar">
    <TabBarItem v-for="item in tabList" :key="item.name" :path=item.path>
      <template v-slot:icon>
        <div class="icon">
          <span class="iconfont icon-home-fill" :class="item.icon"></span>
        </div>
      </template>
      <template v-slot:text>
        <div class="text">
          {{item.name}}
        </div>
      </template>
    </TabBarItem>
  </div>
</template>

<script>
import TabBarItem from './TabBarItem.vue'
export default {
  data () {
    return {
      tabList: [
        {
          name: '首页',
          icon: 'icon-home-fill',
          path: '/index'
        }, {
          name: '分类',
          icon: 'icon-all-fill',
          path: '/list'
        }, {
          name: '灵感',
          icon: 'icon-credit-level-fill',
          path: '/ins'
        }, {
          name: '文章',
          icon: 'icon-integral-fill',
          path: '/art'
        }
      ]
    }
  },
  components: {
    TabBarItem
  }
}
</script>

<style lang="less" scoped>
.tabBar{
  height: 1rem;
  background-color: #fff;
  border: 1px solid #ccc;
  font-size: 0.3rem;
  display: flex;
  justify-content: space-around;
}
</style>
